{extends file="../acp.html"}

{block name="title"}{$head_title}{/block}
{block name="content"}
<form name="form1" id="form1" action="" method="post">
<div class="formitems inline">  
    <label class="fi-name"><span class="colorRed">*</span>标题：</label>  
    <div class="form-controls">  
        <input type="text" placeholder="" class="xlarge" name="title" id="title" value="{$help_data.title}">  
		<span class="fi-help-text hide"></span>
	</div>  
</div> 
<div class="formitems inline">  
    <label class="fi-name"><span class="colorRed">*</span>所属栏目：</label>  
    <div class="form-controls">  
        <select name="sort_id" id="sort_id">  
            <option value="">--请选择--</option>  
            {html_options options=$help_center_category_options selected=$help_data.help_sort_id}
        </select>   
		<span class="fi-help-text hide"></span>
    </div>  
</div> 
<div class="formitems inline">  
    <label class="fi-name">排序：</label>  
    <div class="form-controls">  
        <input type="text" placeholder="" class="mini" style=" width:45px;" name="serial" id="serial" value="{$help_data.serial}"> 
    </div>  
</div>
<div class="formitems inline">  
    <label class="fi-name">显示：</label>  
    <div class="form-controls">  
        <div class="radio-group">  
            <label><input type="radio" name="isuse" value="1" {if $help_data.isuse == 1}checked="checked"{/if}>是</label>  
            <label><input type="radio" name="isuse" value="0" {if $help_data.isuse == 0}checked="checked"{/if}>否</label>   
        </div>  
    </div>  
</div> 
<!-- <div class="formitems inline">  
    <label class="fi-name">在首页导航栏显示：</label>  
    <div class="form-controls">  
        <div class="radio-group">  
            <label><input type="radio" name="is_navigator_show" value="1" {if $help_data.is_navigator_show == 1}checked="checked"{/if}>是</label>  
            <label><input type="radio" name="is_navigator_show" value="0" {if $help_data.is_navigator_show == 0}checked="checked"{/if}>否</label>   
        </div>  
    </div>  
</div> 
<div class="formitems inline">  
    <label class="fi-name">在网站底部显示：</label>  
    <div class="form-controls">  
        <div class="radio-group">  
            <label><input type="radio" name="is_bottom_show" value="1" {if $help_data.is_bottom_show == 1}checked="checked"{/if}>是</label>  
            <label><input type="radio" name="is_bottom_show" value="0" {if $help_data.is_bottom_show == 0}checked="checked"{/if}>否</label>   
        </div>  
    </div>  
</div>  -->
<div class="formitems inline">  
    <label class="fi-name">内容：</label>  
    <div class="form-controls" id="ke">  
        <textarea name="contents" id="contents" class="large">{$help_data.contents}</textarea>
    </div>  
</div> 
<div class="formitems inline">  
    <label class="fi-name"></label>  
    <div class="form-controls">  
		<input type="hidden" name="act" value="submit" />
        <button type="submit" class="btn btn-blue"><i class="gicon-check white"></i>保存</button>  
    </div>  
</div> 
</form>
{/block} 

{block name="js"}
<!-- 编辑器 -->
<link rel="stylesheet" href="__KD__/themes/default/default.css" />
<script charset="utf-8" src="__KD__/kindeditor.js?version={$version}" > </script>
<script charset="utf-8" src="__KD__/lang/zh_CN.js?version={$version}" > </script>
<script >
	KindEditor.ready( function (K) {
		var editor1 = K.create( 'textarea[name="contents"]' , {
			uploadJson : '__APP__/Acp/uploadHandler' ,
			width : '500px' ,
			height : '300px' ,
			minWidth : '500px' ,
			minHeight : '300px' ,
			fillDescAfterUploadImage : false,
			allowFileManager : false,
			items : [ 'bold' , 'italic' , 'underline' , '|' , 'insertorderedlist' , 'insertunorderedlist' , 'image' , 'multiimage' , 'link' , '|' , 'unlink' , 'removeformat' , 'forecolor' , 'hilitecolor' , 'fullscreen' ],
			afterCreate : function () {
				var self = this;
				K.ctrl(document, 13 , function () {
					self.sync();
					K( 'form[name=form1]' )[ 0 ].submit();
				});
				K.ctrl(self.edit.doc, 13 , function () {
					self.sync();
					K( 'form[name=form1]' )[ 0 ].submit();
				});
			},
			afterUpload : function(url) {
				$('#ke').append('<input type="hidden" name="help_txt_images[]" value="' + url + '" />');
			}
		});
	});
	$(function(){
		$("#form1").validate({
			rules: {
				title: {
					required: true
				},
				sort_id: {
					equal_select: true
				}
			},
			messages: {
				title: {
					required: "请输入标题"
				},
				sort_id: {
					equal_select: "请选择所属栏目"
				}
			},
			errorPlacement: acp.form_ShowError,//显示出错信息(这段代码必须加)
			success:acp.form_HideError//验证成功隐藏错误信息(这段代码必须加)
		});
	});
</script>
{/block} 

{block name="css"}
<link rel="stylesheet" href="/Public/Css/acp/AcpSuggest/add_suggest.css"  type="text/css"/>
{/block}
